#ifndef LOADAREA_H
#define LOADAREA_H

#include <Command.h>
#include <World.h>
#include <Area.h>

template <typename T>
class LoadArea : public Command
{
	public:
		LoadArea(World* worldptr);
		virtual ~LoadArea();
		virtual truth Execute();

	private:
		World* world;
};

template <typename T>
LoadArea<T>::LoadArea(World* worldptr)
:Command(CommandType::BLOCKING)
,world(worldptr)
{}

template <typename T>
LoadArea<T>::~LoadArea() 
{}

template <typename T>
truth LoadArea<T>::Execute()
{
	world->SetArea(new T(*world));
	world->InitCurrentArea();
	Global::SetDebugMode(0);
	complete = 1;
	world->SetMainMenu( 0 );
	
	return 1;
}

#endif